home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / bash / bash_108 / src_d2.zoo / bash-d2.zoo / st-bash-src / src.diff < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-03  |  46.5 KB  |  1,772 lines

  1. diff -c ./alias.c /home/scott/work/bash-1.08/st-bash-src/alias.c
  2. *** ./alias.c    Tue Aug 27 08:56:13 1991
  3. --- /home/scott/work/bash-1.08/st-bash-src/alias.c    Fri Jul 26 15:51:46 1991
  4. ***************
  5. *** 92,98 ****
  6.         if ((aliases_length + 1) >= aliases_size)
  7.       {
  8.         aliases =
  9. !         (ASSOC **)xrealloc (aliases,
  10.                   (aliases_size += alias_list_grow_amount)
  11.                   * sizeof (ASSOC *));
  12.       }
  13. --- 92,98 ----
  14.         if ((aliases_length + 1) >= aliases_size)
  15.       {
  16.         aliases =
  17. !         (ASSOC **)xrealloc ((char *)aliases,
  18.                   (aliases_size += alias_list_grow_amount)
  19.                   * sizeof (ASSOC *));
  20.       }
  21. diff -c ./bashline.c /home/scott/work/bash-1.08/st-bash-src/bashline.c
  22. *** ./bashline.c    Sun May 19 17:54:16 1991
  23. --- /home/scott/work/bash-1.08/st-bash-src/bashline.c    Wed Aug 14 11:14:46 1991
  24. ***************
  25. *** 35,45 ****
  26.   
  27.   static char
  28.     **attempt_shell_completion (), *bash_tilde_expand (),
  29. !   *variable_completion_function (), *hostname_completion_function (),
  30.     *command_word_completion_function ();
  31.   
  32.   static void
  33.     snarf_hosts_from_file (), add_host_name (), sort_hostname_list ();
  34.   
  35.   /* Externally defined functions used by this file. */
  36.   extern char
  37. --- 35,57 ----
  38.   
  39.   static char
  40.     **attempt_shell_completion (), *bash_tilde_expand (),
  41. !   *variable_completion_function (), 
  42. ! /**
  43. !  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  44. !  **/
  45. ! #if !defined(atarist)
  46. ! *hostname_completion_function (),
  47. ! #endif
  48.     *command_word_completion_function ();
  49.   
  50. + /**
  51. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  52. +  **/
  53. + #if !defined(atarist)
  54.   static void
  55.     snarf_hosts_from_file (), add_host_name (), sort_hostname_list ();
  56. + #endif 
  57.   
  58.   /* Externally defined functions used by this file. */
  59.   extern char
  60. ***************
  61. *** 62,69 ****
  62. --- 74,86 ----
  63.     bash_complete_filename_internal (),
  64.     bash_complete_username (), bash_possible_username_completions (),
  65.     bash_complete_username_internal (),
  66. + /**
  67. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  68. +  **/
  69. + #if !defined(atarist)
  70.     bash_complete_hostname (), bash_possible_hostname_completions (),
  71.     bash_complete_hostname_internal (),
  72. + #endif 
  73.     bash_complete_variable (), bash_possible_variable_completions (),
  74.     bash_complete_variable_internal (),
  75.     bash_complete_command (), bash_possible_command_completions (),
  76. ***************
  77. *** 116,126 ****
  78. --- 133,148 ----
  79.     rl_bind_key_in_map ('~', bash_possible_username_completions,
  80.                 emacs_ctlx_keymap);
  81.   
  82. + /**
  83. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  84. +  **/
  85. + #if !defined(atarist)
  86.     rl_add_defun ("complete-hostname", bash_complete_hostname, META('@'));
  87.     rl_add_defun ("possible-hostname-completions",
  88.           bash_possible_hostname_completions, -1);
  89.     rl_bind_key_in_map ('@', bash_possible_hostname_completions,
  90.                 emacs_ctlx_keymap);
  91. + #endif 
  92.   
  93.     rl_add_defun ("complete-variable", bash_complete_variable, META('$'));
  94.     rl_add_defun ("possible-variable-completions",
  95. ***************
  96. *** 211,216 ****
  97. --- 233,242 ----
  98.   /*                                    */
  99.   /* **************************************************************** */
  100.   
  101. + /**
  102. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  103. +  **/
  104. + #if !defined(atarist)
  105.   /* If the user requests hostname completion, then simply build a list
  106.      of hosts, and complete from that forever more. */
  107.   #if !defined (ETCHOSTS)
  108. ***************
  109. *** 255,261 ****
  110.     if (hostname_list_length + 2 > hostname_list_size)
  111.       {
  112.         hostname_list = (char **)
  113. !     xrealloc (hostname_list,
  114.             (1 + (hostname_list_size += 100)) * sizeof (char *));
  115.       }
  116.   
  117. --- 281,287 ----
  118.     if (hostname_list_length + 2 > hostname_list_size)
  119.       {
  120.         hostname_list = (char **)
  121. !     xrealloc ((char *)hostname_list,
  122.             (1 + (hostname_list_size += 100)) * sizeof (char *));
  123.       }
  124.   
  125. ***************
  126. *** 412,417 ****
  127. --- 438,444 ----
  128.       }
  129.     return ((char **)NULL);
  130.   }
  131. + #endif 
  132.   
  133.   /* This is a K*rn shell style insert-last-arg function.  The
  134.      difference is that Bash puts stuff into the history file before
  135. ***************
  136. *** 539,548 ****
  137. --- 566,580 ----
  138.   
  139.     /* Another one.  Why not?  If the word starts in '@', then look through
  140.        the world of known hostnames for completion first. */
  141. + /**
  142. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  143. +  **/
  144. + #if !defined(atarist)
  145.     if (!matches && *text == '@')
  146.       {
  147.         matches = completion_matches (text, hostname_completion_function);
  148.       }
  149. + #endif 
  150.   
  151.     /* And last, (but not least) if this word is in a command position, then
  152.        complete over possible command names, including aliases, functions,
  153. ***************
  154. *** 785,790 ****
  155. --- 817,826 ----
  156.       }
  157.   }
  158.   
  159. + /**
  160. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  161. +  **/
  162. + #if !defined(atarist)
  163.   /* How about a completion function for hostnames? */
  164.   static char *
  165.   hostname_completion_function (text, state)
  166. ***************
  167. *** 827,832 ****
  168. --- 863,869 ----
  169.     else
  170.       return ((char *)NULL);
  171.   }
  172. + #endif 
  173.   
  174.   /* History and alias expand the line.  But maybe do more?  This
  175.      is a test to see what users like.  Do expand_string on the string. */
  176. ***************
  177. *** 987,993 ****
  178.       {
  179.         if (numitems + 1 > maxitems)
  180.       ignores = (struct ign *)
  181. !       xrealloc (ignores, (maxitems += 10) * sizeof (struct ign));
  182.   
  183.         ignores[numitems].val = colon_bit;
  184.         ignores[numitems].len = strlen (colon_bit);
  185. --- 1024,1030 ----
  186.       {
  187.         if (numitems + 1 > maxitems)
  188.       ignores = (struct ign *)
  189. !       xrealloc ((char *)ignores, (maxitems += 10) * sizeof (struct ign));
  190.   
  191.         ignores[numitems].val = colon_bit;
  192.         ignores[numitems].len = strlen (colon_bit);
  193. ***************
  194. *** 1153,1158 ****
  195. --- 1190,1199 ----
  196.     rl_completer_word_break_characters = orig_rl_completer_word_break_characters;
  197.   }
  198.   
  199. + /**
  200. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  201. +  **/
  202. + #if !defined(atarist)
  203.   static void
  204.   bash_complete_hostname (ignore, ignore2)
  205.        int ignore, ignore2;
  206. ***************
  207. *** 1166,1171 ****
  208. --- 1207,1213 ----
  209.   {
  210.     bash_complete_hostname_internal ('?');
  211.   }
  212. + #endif 
  213.   
  214.   static void
  215.   bash_complete_variable (ignore, ignore2)
  216. ***************
  217. *** 1196,1201 ****
  218. --- 1238,1247 ----
  219.     bash_complete_command_internal ('?');
  220.   }
  221.   
  222. + /**
  223. +  ** (sjk)++ Remove hostname/mail references on the Atari ST.
  224. +  **/
  225. + #if !defined(atarist)
  226.   static void
  227.   bash_complete_hostname_internal (what_to_do)
  228.        int what_to_do;
  229. ***************
  230. *** 1203,1208 ****
  231. --- 1249,1255 ----
  232.     bash_specific_completion
  233.       (what_to_do, (Function *)hostname_completion_function);
  234.   }
  235. + #endif 
  236.   
  237.   static void
  238.   bash_complete_variable_internal (what_to_do)
  239. diff -c ./braces.c /home/scott/work/bash-1.08/st-bash-src/braces.c
  240. *** ./braces.c    Thu May 16 04:08:22 1991
  241. --- /home/scott/work/bash-1.08/st-bash-src/braces.c    Fri Jul 26 16:01:46 1991
  242. ***************
  243. *** 110,116 ****
  244.   #if defined (SHELL)
  245.     /* If the amble does not contain BRACE_ARG_SEPARATOR, then just return
  246.        without doing any expansion.  */
  247. !   if (index (amble, brace_arg_separator) == NULL)
  248.       {
  249.         free (amble);
  250.         free (preamble);
  251. --- 110,116 ----
  252.   #if defined (SHELL)
  253.     /* If the amble does not contain BRACE_ARG_SEPARATOR, then just return
  254.        without doing any expansion.  */
  255. !   if (index (amble, brace_arg_separator) == (int)NULL)
  256.       {
  257.         free (amble);
  258.         free (preamble);
  259. ***************
  260. *** 164,170 ****
  261.         register int lp = array_len (partial);
  262.         register int j;
  263.   
  264. !       result = (char **)xrealloc (result, (1 + lp + lr) * sizeof (char *));
  265.   
  266.         for (j = 0; j < lp; j++)
  267.           result[lr + j] = partial[j];
  268. --- 164,170 ----
  269.         register int lp = array_len (partial);
  270.         register int j;
  271.   
  272. !       result = (char **)xrealloc ((char *)result, (1 + lp + lr) * sizeof (char *));
  273.   
  274.         for (j = 0; j < lp; j++)
  275.           result[lr + j] = partial[j];
  276. diff -c ./builtins.c /home/scott/work/bash-1.08/st-bash-src/builtins.c
  277. *** ./builtins.c    Tue Aug 27 08:56:16 1991
  278. --- /home/scott/work/bash-1.08/st-bash-src/builtins.c    Thu Aug 15 21:35:17 1991
  279. ***************
  280. *** 30,35 ****
  281. --- 30,41 ----
  282.   #if defined (HAVE_RESOURCE) && !defined (hpux)
  283.   #include <sys/time.h>
  284.   #include <sys/resource.h>
  285. + /** 
  286. +  ** (sjk)++ Add sys/times.h on an Atari ST
  287. +  **/
  288. + #if defined(atarist)
  289. + #include <sys/times.h>
  290. + #endif
  291.   #else /* !HAVE_RESOURCE || hpux */
  292.   #include <sys/times.h>
  293.   #endif /* !HAVE_RESOURCE || hpux */
  294. ***************
  295. *** 56,63 ****
  296. --- 62,77 ----
  297.   
  298.   /* Yecch!  Who cares about this gross concept in the first place? */
  299.   #ifndef MAXPATHLEN
  300. + /** 
  301. +  ** (sjk)++ Adjust MAXPATHLEN to jive with definition on the Atari ST. 
  302. +  **         (should be made to depend on standard headers).
  303. +  **/
  304. + #if !defined(atarist)
  305.   #define MAXPATHLEN 1024
  306. + #else 
  307. + #define MAXPATHLEN 128
  308.   #endif
  309. + #endif
  310.   
  311.   /* The command name of the currently running function. */
  312.   extern char *this_command_name;
  313. ***************
  314. *** 1072,1078 ****
  315.     }
  316.   
  317.     if (list)
  318. !     {
  319.         char *extract_colon_unit ();
  320.         char *path_string = get_string_value ("CDPATH");
  321.         char *path;
  322. --- 1086,1092 ----
  323.     }
  324.   
  325.     if (list)
  326. !     { 
  327.         char *extract_colon_unit ();
  328.         char *path_string = get_string_value ("CDPATH");
  329.         char *path;
  330. ***************
  331. *** 1080,1087 ****
  332.   
  333.         dirname = list->word->word;
  334.   
  335. !       if (path_string && !absolute_pathname (dirname))
  336. !     {
  337.         while ((path = extract_colon_unit (path_string, &index)))
  338.           {
  339.             char *dir;
  340. --- 1094,1120 ----
  341.   
  342.         dirname = list->word->word;
  343.   
  344. ! /**
  345. !  ** (sjk)++ If on an Atari ST give ?:* a real crack at it.
  346. !  **/
  347. ! #if defined(atarist)
  348. !       if ( dirname && (strlen(dirname)>=2) )
  349. !         if (dirname[1]==':')
  350. !           { int i = strlen(dirname);
  351. !             char *dn; dn = alloca(strlen(dirname));
  352. !             --i;
  353. !             strcpy(dn,dirname);
  354. !             if (dn[i] == '/') dn[i]='\000';
  355. !             if (chdir(dn) >= 0) 
  356. !               { strcpy(dirname,dn);
  357. !                 strcpy(the_current_working_directory,dn);
  358. !                 goto bind_and_exit;
  359. !           }
  360. !           }
  361. ! #endif
  362. !             
  363. !     if (path_string && !absolute_pathname (dirname))
  364. !     { /* Path_String && !absolute_pathname */
  365.         while ((path = extract_colon_unit (path_string, &index)))
  366.           {
  367.             char *dir;
  368. ***************
  369. *** 2674,2680 ****
  370.         if (!dollar_arg_stack)
  371.       {
  372.         dollar_arg_stack =
  373. !         (WORD_LIST **)xrealloc (dollar_arg_stack,
  374.                       (dollar_arg_stack_slots += 10)
  375.                       * sizeof (WORD_LIST **));
  376.       }
  377. --- 2707,2713 ----
  378.         if (!dollar_arg_stack)
  379.       {
  380.         dollar_arg_stack =
  381. !         (WORD_LIST **)xrealloc ((char *)dollar_arg_stack,
  382.                       (dollar_arg_stack_slots += 10)
  383.                       * sizeof (WORD_LIST **));
  384.       }
  385. ***************
  386. *** 2846,2852 ****
  387.   times_builtin (list)
  388.        WORD_LIST *list;
  389.   {
  390. ! #if defined (HAVE_RESOURCE) && !defined (hpux)
  391.     struct rusage self, kids;
  392.   
  393.     no_args (list);
  394. --- 2879,2889 ----
  395.   times_builtin (list)
  396.        WORD_LIST *list;
  397.   {
  398. ! /** 
  399. !  ** (sjk)++ Adjust times builtin for Atari ST
  400. !  **/
  401. ! #if (defined (HAVE_RESOURCE) && !defined (hpux)) && !defined(atarist)
  402.     struct rusage self, kids;
  403.   
  404.     no_args (list);
  405. ***************
  406. *** 3958,3964 ****
  407.         if (directory_list_offset == directory_list_size)
  408.           {
  409.             pushd_directory_list = (char **)
  410. !         xrealloc (pushd_directory_list,
  411.                 (directory_list_size += 10) * sizeof (char *));
  412.           }
  413.         pushd_directory_list[directory_list_offset++] = current_directory;
  414. --- 3995,4001 ----
  415.         if (directory_list_offset == directory_list_size)
  416.           {
  417.             pushd_directory_list = (char **)
  418. !         xrealloc ((char *)pushd_directory_list,
  419.                 (directory_list_size += 10) * sizeof (char *));
  420.           }
  421.         pushd_directory_list[directory_list_offset++] = current_directory;
  422. diff -c ./config.h /home/scott/work/bash-1.08/st-bash-src/config.h
  423. *** ./config.h    Tue Aug 27 08:56:17 1991
  424. --- /home/scott/work/bash-1.08/st-bash-src/config.h    Tue Jun 18 00:05:22 1991
  425. ***************
  426. *** 64,70 ****
  427.   
  428.   /* Define JOB_CONTROL if your operating system supports
  429.      BSD-like job control. */
  430. ! #define JOB_CONTROL
  431.   
  432.   /* Note that vanilla System V machines don't support BSD job control, 
  433.      although some do support Posix job control. */
  434. --- 64,70 ----
  435.   
  436.   /* Define JOB_CONTROL if your operating system supports
  437.      BSD-like job control. */
  438. ! /* #define JOB_CONTROL */
  439.   
  440.   /* Note that vanilla System V machines don't support BSD job control, 
  441.      although some do support Posix job control. */
  442. diff -c ./execute_cmd.c /home/scott/work/bash-1.08/st-bash-src/execute_cmd.c
  443. *** ./execute_cmd.c    Tue Aug 27 08:56:20 1991
  444. --- /home/scott/work/bash-1.08/st-bash-src/execute_cmd.c    Fri Aug 30 14:05:48 1991
  445. ***************
  446. *** 18,23 ****
  447. --- 18,31 ----
  448.      along with Bash; see the file COPYING.  If not, write to the Free
  449.      Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  450.   
  451. + /**
  452. +  ** (sjk)++ Needed for the new implimentation of do_piping()
  453. +  **
  454. +  **/
  455. + #if defined(atarist)
  456. + #include <osbind.h>
  457. + #endif
  458.   #include <stdio.h>
  459.   #include <ctype.h>
  460.   #include <sys/types.h>
  461. ***************
  462. *** 531,537 ****
  463.              We take care of that here.  This passes around a bitmap
  464.              of file descriptors that must be closed after making a
  465.              child process in execute_simple_command. */
  466.           struct fd_bitmap *fd_bitmap1, *fd_bitmap2;
  467.           int newsize;
  468.   
  469. --- 539,549 ----
  470.              We take care of that here.  This passes around a bitmap
  471.              of file descriptors that must be closed after making a
  472.              child process in execute_simple_command. */
  473. ! /** 
  474. !  ** (sjk)++ This above described problem does not exists on the 
  475. !  **         atari ST because of my brain dead pipe implementation.
  476. !  **/
  477. ! #if !defined(atarist)
  478.           struct fd_bitmap *fd_bitmap1, *fd_bitmap2;
  479.           int newsize;
  480.   
  481. ***************
  482. *** 560,566 ****
  483.   
  484.           bcopy (fds_to_close->bitmap, fd_bitmap2->bitmap,
  485.                  fds_to_close->size);
  486.           /* And mark the pipe file descriptors to be closed. */
  487.           fd_bitmap1->bitmap[fildes[0]] = 1;
  488.           fd_bitmap2->bitmap[fildes[1]] = 1; 
  489. --- 572,577 ----
  490. ***************
  491. *** 574,579 ****
  492. --- 585,591 ----
  493.           add_unwind_protect (close_fd_bitmap, fd_bitmap2);
  494.           add_unwind_protect (dispose_fd_bitmap, fd_bitmap1);
  495.           add_unwind_protect (dispose_fd_bitmap, fd_bitmap2);
  496.           execute_command_internal (command->value.Connection->first,
  497.                         asynchronous, pipe_in, fildes[1],
  498.                         fd_bitmap1);
  499. ***************
  500. *** 582,593 ****
  501. --- 594,617 ----
  502.             execute_command_internal (command->value.Connection->second,
  503.                           asynchronous, fildes[0], pipe_out,
  504.                           fd_bitmap2);
  505. + #else 
  506. +         execute_command_internal (command->value.Connection->first,
  507. +                       asynchronous, pipe_in, fildes[1],
  508. +                       fds_to_close);
  509.   
  510. +         exec_result =
  511. +           execute_command_internal (command->value.Connection->second,
  512. +                         asynchronous, fildes[0], pipe_out,
  513. +                         fds_to_close);
  514. + #endif
  515. + #if !defined(atarist)
  516.           /* We cannot call close_fd_bitmap () here.  Doing so will
  517.              cause pipelines with > 2 processes to hang. */
  518.           dispose_fd_bitmap (fd_bitmap1);
  519.           dispose_fd_bitmap (fd_bitmap2);
  520.           discard_unwind_frame ("pipe-file-descriptors");
  521. + #endif
  522.             }
  523.         }
  524.         break;
  525. ***************
  526. *** 1322,1335 ****
  527.   
  528.       if (!absolute_program (words->word->word))
  529.         hashed_file = find_hashed_filename (words->word->word);
  530.       if (hashed_file)
  531.         command = savestring (hashed_file);
  532.       else
  533. !       {
  534. !         /* A command containing a slash is not looked up in PATH. */
  535. !         if (absolute_program (words->word->word))
  536. !           command = savestring (words->word->word);
  537.           else
  538.             command = find_user_command (words->word->word);
  539.           if (command && !hashing_disabled)
  540. --- 1346,1383 ----
  541.   
  542.       if (!absolute_program (words->word->word))
  543.         hashed_file = find_hashed_filename (words->word->word);
  544. !         
  545.       if (hashed_file)
  546.         command = savestring (hashed_file);
  547.       else
  548. !       { if (absolute_program (words->word->word))
  549. !               { 
  550. ! /** 
  551. !  ** (sjk)++ Add checking of extensions {.tos/.ttp/.prg} on absolute
  552. !  **         paths on the Atari ST.
  553. !  **/
  554. ! #if defined(atarist)
  555. !         char *name_suffix = alloca(4 + strlen(words->word->word));
  556. !                 struct stat finfo;
  557. !                 strcpy(name_suffix,words->word->word);
  558. !                   if (0 != stat(name_suffix,&finfo))
  559. !                  { strcat(name_suffix,".tos");
  560. !                        if (0 != stat(name_suffix,&finfo)) 
  561. !                           { strcpy(name_suffix,words->word->word);
  562. !                             strcat(name_suffix,".ttp");
  563. !                             if (0 != stat(name_suffix,&finfo)) 
  564. !                        { strcpy(name_suffix,words->word->word);
  565. !                                  strcat(name_suffix,".prg");
  566. !                                  if (0 != stat(name_suffix,&finfo))
  567. !                                     strcpy(name_suffix,words->word->word);
  568. !                    }
  569. !               }
  570. !              }
  571. !                      command = savestring (name_suffix);
  572. ! #else
  573. !               command = savestring (words->word->word);
  574. ! #endif
  575. !           }
  576.           else
  577.             command = find_user_command (words->word->word);
  578.           if (command && !hashing_disabled)
  579. ***************
  580. *** 1350,1357 ****
  581.          of COMMAND, since we want the error messages to be redirected. */
  582.         
  583.       if (make_child (savestring (command_line), async) == 0)
  584. !       {
  585. !         do_piping (pipe_in, pipe_out);
  586.   
  587.           /* Execve expects the command name to be in args[0].  So we
  588.              leave it there, in the same format that the user used to
  589. --- 1398,1405 ----
  590.          of COMMAND, since we want the error messages to be redirected. */
  591.         
  592.       if (make_child (savestring (command_line), async) == 0)
  593. !       { 
  594. !             do_piping (pipe_in, pipe_out);
  595.   
  596.           /* Execve expects the command name to be in args[0].  So we
  597.              leave it there, in the same format that the user used to
  598. ***************
  599. *** 1471,1477 ****
  600.                 /* Insert the name of this shell into the
  601.                argument list. */
  602.                 args =
  603. !             (char **)xrealloc (args, (1 + larry) * sizeof (char *));
  604.                 for (i = larry - 1; i; i--)
  605.               args[i] = args[i - 1];
  606.   
  607. --- 1519,1525 ----
  608.                 /* Insert the name of this shell into the
  609.                argument list. */
  610.                 args =
  611. !             (char **)xrealloc ((char *)args, (1 + larry) * sizeof (char *));
  612.                 for (i = larry - 1; i; i--)
  613.               args[i] = args[i - 1];
  614.   
  615. ***************
  616. *** 1521,1529 ****
  617.           exit (EXECUTION_FAILURE);
  618.             }
  619.         }
  620.       else
  621. !       {
  622. !         /* Make sure that the pipes are closed in the parent. */
  623.           close_pipes (pipe_in, pipe_out);
  624.           if (command)
  625.             free (command);
  626. --- 1569,1584 ----
  627.           exit (EXECUTION_FAILURE);
  628.             }
  629.         }
  630. +     
  631.       else
  632. !       { /* Make sure that the pipes are closed in the parent. */
  633. !       
  634. ! /**
  635. !  ** On the Atari ST force GEMDOS buffers into RTL buffers.
  636. !  **/      
  637. ! #if defined(atarist)
  638. !             flush_key_buff(fileno(stdin));
  639. ! #endif
  640.           close_pipes (pipe_in, pipe_out);
  641.           if (command)
  642.             free (command);
  643. ***************
  644. *** 1588,1604 ****
  645.      NO_PIPE and REDIRECT_BOTH are handled correctly. */
  646.   do_piping (pipe_in, pipe_out)
  647.        int pipe_in, pipe_out;
  648. ! {
  649.     if (pipe_in != NO_PIPE)
  650.       {
  651. !       dup2 (pipe_in, 0);
  652.         close (pipe_in);
  653.       }
  654.     if (pipe_out != NO_PIPE)
  655.       {
  656. !       dup2 (pipe_out, 1);
  657.         close (pipe_out);
  658.         if (pipe_out == REDIRECT_BOTH)
  659.       dup2 (1, 2);
  660.       }
  661. --- 1643,1667 ----
  662.      NO_PIPE and REDIRECT_BOTH are handled correctly. */
  663.   do_piping (pipe_in, pipe_out)
  664.        int pipe_in, pipe_out;
  665. ! { int res;
  666.     if (pipe_in != NO_PIPE)
  667.       {
  668. !       res = dup2 (pipe_in, 0);
  669. !       if (res < 0) 
  670. !         fprintf(stderr,"pipe_in - dup2:%d, errno:%d\n",res,errno);
  671. ! #if !defined(atarist)
  672.         close (pipe_in);
  673. + #endif
  674.       }
  675.     if (pipe_out != NO_PIPE)
  676.       {
  677. !       res = dup2 (pipe_out, 1);
  678. !       if (res < 0)  
  679. !         fprintf(stderr,"pipe_in - dup2:%d, errno:%d\n",res,errno);
  680. ! #if !defined(atarist)
  681.         close (pipe_out);
  682. ! #endif
  683.         if (pipe_out == REDIRECT_BOTH)
  684.       dup2 (1, 2);
  685.       }
  686. ***************
  687. *** 2111,2118 ****
  688. --- 2174,2213 ----
  689.        char *name;
  690.   {
  691.     char *find_user_command_internal ();
  692. + /**
  693. +  ** (sjk)++ Check the extensions {.tos/.ttp/.prg} for a user command.
  694. +  **/
  695. + #if defined(atarist)
  696. +   char *win,*name_suffix;
  697. +   name_suffix = (char *)alloca(4 + strlen(name)); 
  698. + #endif
  699.   
  700. + #if !defined(atarist)
  701.     return (find_user_command_internal (name, 1));
  702. + #else  /* Must be an Atari ST */
  703. +   win = find_user_command_internal(name, 1);
  704. +   if (win != (char *)NULL) return(win);
  705. +  
  706. +   strcpy(name_suffix,name);
  707. +   strcat(name_suffix,".ttp");
  708. +   win = (char *)find_user_command_internal(name_suffix, 1);
  709. +   if (win != (char *)NULL) return(win);
  710. +   strcpy(name_suffix,name);
  711. +   strcat(name_suffix,".tos");
  712. +   win = (char *)find_user_command_internal(name_suffix, 1);
  713. +   if (win != (char *)NULL) return(win);
  714. +   strcpy(name_suffix,name);
  715. +   strcat(name_suffix,".prg");
  716. +   win = (char *)find_user_command_internal(name_suffix, 1);
  717. +   if (win != (char *)NULL) return(win);
  718. +   return(win);
  719. + #endif                               
  720.   }
  721.   
  722.   /* Locate the file referenced by NAME, searching along the contents
  723. ***************
  724. *** 2194,2200 ****
  725.   
  726.         if (match_index + 1 == match_list_size)
  727.           match_list =
  728. !           (char **)xrealloc (match_list,
  729.                    ((match_list_size += 10) + 1) * sizeof (char *));
  730.         match_list[match_index++] = match;
  731.         match_list[match_index] = (char *)NULL;
  732. --- 2289,2295 ----
  733.   
  734.         if (match_index + 1 == match_list_size)
  735.           match_list =
  736. !           (char **)xrealloc ((char *)match_list,
  737.                    ((match_list_size += 10) + 1) * sizeof (char *));
  738.         match_list[match_index++] = match;
  739.         match_list[match_index] = (char *)NULL;
  740. ***************
  741. *** 2266,2274 ****
  742.        a `.' as the directory path yet. */
  743.     dot_found_in_search = 0;
  744.   
  745.     if (absolute_program (name))
  746.       {
  747. !       full_path = (char *)xmalloc (1 + name_len);
  748.         strcpy (full_path, name);
  749.   
  750.         if (executable_file (full_path) || file_exists_p)
  751. --- 2361,2370 ----
  752.        a `.' as the directory path yet. */
  753.     dot_found_in_search = 0;
  754.   
  755.     if (absolute_program (name))
  756.       {
  757. !       full_path = (char *)xmalloc (1 + strlen(name));
  758.         strcpy (full_path, name);
  759.   
  760.         if (executable_file (full_path) || file_exists_p)
  761. diff -c ./expr.c /home/scott/work/bash-1.08/st-bash-src/expr.c
  762. *** ./expr.c    Tue Aug 27 08:56:20 1991
  763. --- /home/scott/work/bash-1.08/st-bash-src/expr.c    Fri Jul 26 15:50:04 1991
  764. ***************
  765. *** 148,154 ****
  766.     if (expr_depth >= expr_stack_size)
  767.       {
  768.         expr_stack = (EXPR_CONTEXT **)
  769. !     xrealloc (expr_stack, (expr_stack_size += EXPR_STACK_GROW_SIZE)
  770.             * sizeof (EXPR_CONTEXT *));
  771.       }
  772.   
  773. --- 148,154 ----
  774.     if (expr_depth >= expr_stack_size)
  775.       {
  776.         expr_stack = (EXPR_CONTEXT **)
  777. !     xrealloc ((char *)expr_stack, (expr_stack_size += EXPR_STACK_GROW_SIZE)
  778.             * sizeof (EXPR_CONTEXT *));
  779.       }
  780.   
  781. diff -c ./general.c /home/scott/work/bash-1.08/st-bash-src/general.c
  782. *** ./general.c    Tue Aug 27 08:56:21 1991
  783. --- /home/scott/work/bash-1.08/st-bash-src/general.c    Wed Aug 21 13:55:44 1991
  784. ***************
  785. *** 22,27 ****
  786. --- 22,28 ----
  787.   #include <errno.h>
  788.   #include <sys/types.h>
  789.   #include <sys/param.h>
  790.   #include <fcntl.h>
  791.   
  792.   #include "shell.h"
  793. ***************
  794. *** 51,57 ****
  795.   
  796.   char *
  797.   xmalloc (size)
  798. !      int size;
  799.   {
  800.     register char *temp = (char *)malloc (size);
  801.   
  802. --- 52,58 ----
  803.   
  804.   char *
  805.   xmalloc (size)
  806. ! long size;
  807.   {
  808.     register char *temp = (char *)malloc (size);
  809.   
  810. ***************
  811. *** 64,70 ****
  812.   char *
  813.   xrealloc (pointer, size)
  814.        register char *pointer;
  815. !      int size;
  816.   {
  817.     char *temp;
  818.   
  819. --- 65,71 ----
  820.   char *
  821.   xrealloc (pointer, size)
  822.        register char *pointer;
  823. ! long size;
  824.   {
  825.     char *temp;
  826.   
  827. ***************
  828. *** 140,148 ****
  829.   unset_nodelay_mode (fd)
  830.        int fd;
  831.   {
  832.     int flags, set = 0;
  833.   
  834. !   if ((flags = fcntl (fd, F_GETFL, 0)) < 0)
  835.       return;
  836.   
  837.   #if defined (O_NONBLOCK)
  838. --- 141,157 ----
  839.   unset_nodelay_mode (fd)
  840.        int fd;
  841.   {
  842. + /**
  843. +  ** (sjk)++ We remove the call to make stdin a noblocking stream, since this 
  844. +             is not a feature of our limited fcntl() call. No blocking Input 
  845. +         is however taken care of by the console_input_status()
  846. +             and console_read_byte() pair in the readline source code.
  847. +  **/
  848. + #if !defined(atarist)
  849.     int flags, set = 0;
  850.   
  851. !   if ((flags = fcntl(fd, F_GETFL, 0)) < 0)
  852.       return;
  853.   
  854.   #if defined (O_NONBLOCK)
  855. ***************
  856. *** 163,168 ****
  857. --- 172,178 ----
  858.   
  859.     if (set)
  860.       fcntl (fd, F_SETFL, flags);
  861. + #endif 
  862.   }
  863.   
  864.   
  865. ***************
  866. *** 347,354 ****
  867. --- 357,373 ----
  868.      begin with. */
  869.   
  870.   #ifndef MAXPATHLEN
  871. + /**
  872. +  ** (sjk)++ Adjust the MAXPATHLEN on the Atari ST, note that this should be 
  873. +  **         done in a more independent way (by including a standard header).
  874. +  **/
  875. + #if !defined(atarist)
  876.   #define MAXPATHLEN 1024
  877. + #else 
  878. + #define MAXPATHLEN 128
  879.   #endif
  880. + #endif
  881.   
  882.   static char current_path[MAXPATHLEN];
  883.   
  884. ***************
  885. *** 358,363 ****
  886. --- 377,391 ----
  887.   {
  888.     register char *cp;
  889.   
  890. + /** 
  891. +  ** (sjk)++ let the string "[a..z]:" pass through as is is a valid drive 
  892. +  **         specification on the Atari ST.
  893. +  **/
  894. + #if defined(atarist)
  895. +   if ((strlen(string)>1) && (string[1] == ':'))
  896. +     return(savestring (string));
  897. + #endif 
  898. +  
  899.     if (!dot_path || *string == '/')
  900.       return (savestring (string));
  901.   
  902. diff -c ./general.h /home/scott/work/bash-1.08/st-bash-src/general.h
  903. *** ./general.h    Fri May 17 19:58:24 1991
  904. --- /home/scott/work/bash-1.08/st-bash-src/general.h    Wed Aug 14 15:00:28 1991
  905. ***************
  906. *** 72,78 ****
  907.   #define SET_CLOSE_ON_EXEC(fd)    (fcntl ((fd), F_SETFD, FD_CLOEXEC))
  908.   #define SET_OPEN_ON_EXEC(fd)    (fcntl ((fd), F_SETFD, FD_NCLOEXEC))
  909.   
  910. - extern char *xmalloc (), *malloc (), *xrealloc (), *realloc ();
  911.   extern char *itos ();
  912.   
  913.   #endif    /* _GENERAL_ */
  914. --- 72,80 ----
  915.   #define SET_CLOSE_ON_EXEC(fd)    (fcntl ((fd), F_SETFD, FD_CLOEXEC))
  916.   #define SET_OPEN_ON_EXEC(fd)    (fcntl ((fd), F_SETFD, FD_NCLOEXEC))
  917.   
  918.   extern char *itos ();
  919.   
  920.   #endif    /* _GENERAL_ */
  921. diff -c ./mailcheck.c /home/scott/work/bash-1.08/st-bash-src/mailcheck.c
  922. *** ./mailcheck.c    Wed Jan 30 17:04:04 1991
  923. --- /home/scott/work/bash-1.08/st-bash-src/mailcheck.c    Wed Aug 14 13:27:38 1991
  924. ***************
  925. *** 24,29 ****
  926. --- 24,34 ----
  927.   #include <sys/param.h>
  928.   #include "shell.h"
  929.   
  930. + /**
  931. +  ** (sjk)++ Remove all host/mail references on the Atari ST1
  932. +  **/
  933. + #if !defined(atarist)
  934.   #ifndef MAXPATHLEN
  935.   #define MAXPATHLEN 1024
  936.   #endif
  937. ***************
  938. *** 150,155 ****
  939. --- 155,161 ----
  940.     mailfiles_count = 0;
  941.     mailfiles = (FILEINFO **)NULL;
  942.   }
  943. + #endif 
  944.   
  945.   /* Return the full pathname of FILE.  Easy.  Filenames that begin
  946.      with a '/' are returned as themselves.  Other filenames have
  947. ***************
  948. *** 192,197 ****
  949. --- 198,208 ----
  950.     }
  951.   }
  952.   
  953. + /**
  954. +  ** (sjk)++ Remove all host/mail references on the Atari ST
  955. +  **/
  956. + #if !defined(atarist)
  957.   /* Return non-zero if FILE's mod date has changed. */
  958.   file_mod_date_changed (file)
  959.        char *file;
  960. ***************
  961. *** 400,402 ****
  962. --- 411,414 ----
  963.     free (mailpaths);
  964.     bind_variable ("_", dollar_underscore);
  965.   }
  966. + #endif 
  967. diff -c ./nojobs.c /home/scott/work/bash-1.08/st-bash-src/nojobs.c
  968. *** ./nojobs.c    Tue Aug 27 08:56:25 1991
  969. --- /home/scott/work/bash-1.08/st-bash-src/nojobs.c    Wed Aug 14 13:47:32 1991
  970. ***************
  971. *** 46,56 ****
  972.   #define SIGABRT SIGIOT
  973.   #endif
  974.   
  975. ! #if defined (USG) || defined (_POSIX_VERSION)
  976.   #define killpg(pg, sig)        kill(-(pg),(sig))
  977.   #endif
  978.   
  979. ! #if defined (USG)
  980.   #define siginterrupt(sig, code)
  981.   #endif
  982.   
  983. --- 46,62 ----
  984.   #define SIGABRT SIGIOT
  985.   #endif
  986.   
  987. ! /**
  988. !  ** (sjk)++ Remove all host/mail references on the Atari ST1
  989. !  **/
  990. ! #if defined (USG) || defined (_POSIX_VERSION) || defined(atarist)
  991.   #define killpg(pg, sig)        kill(-(pg),(sig))
  992.   #endif
  993.   
  994. ! /**
  995. !  ** (sjk)++ Make siginterrupt() a NULL code on the Atari ST
  996. !  **/
  997. ! #if defined (USG) || defined(atarist)
  998.   #define siginterrupt(sig, code)
  999.   #endif
  1000.   
  1001. ***************
  1002. *** 150,155 ****
  1003. --- 156,168 ----
  1004.     return (pid);
  1005.   }
  1006.   
  1007. + /**
  1008. +  ** (sjk)++ Define ECHILD to be an unknown/general ERROR code for the Atari ST
  1009. +  **/
  1010. + #if defined(atarist)
  1011. + #define ECHILD (-1)
  1012. + #endif
  1013.   /* Wait for a single pid (PID) and return its exit status. */
  1014.   wait_for_single_pid (pid)
  1015.        pid_t pid;
  1016. ***************
  1017. *** 189,195 ****
  1018.         WAIT status;
  1019.   
  1020.         while ((got_pid = wait(&status)) != -1)  /* wait for ECHILD */
  1021. !     ;
  1022.         if (errno != EINTR && errno != ECHILD)
  1023.       {
  1024.         siginterrupt (SIGINT, 0);
  1025. --- 202,209 ----
  1026.         WAIT status;
  1027.   
  1028.         while ((got_pid = wait(&status)) != -1)  /* wait for ECHILD */
  1029. !      printf("Stuck in wait loop with got_pid = %d\n",got_pid);
  1030.         if (errno != EINTR && errno != ECHILD)
  1031.       {
  1032.         siginterrupt (SIGINT, 0);
  1033. ***************
  1034. *** 297,303 ****
  1035. --- 311,324 ----
  1036.   /* Fill the contents of shell_tty_info with the current tty info. */
  1037.   get_tty_state ()
  1038.   {
  1039. + /**
  1040. +  ** (sjk)++ Attach the terminal to CON: on the Atari ST
  1041. +  **/
  1042. + #if !defined(atarist)
  1043.     int tty = open ("/dev/tty", O_RDONLY);
  1044. + #else 
  1045. +   int tty = open("CON:", O_RDONLY);
  1046. + #endif 
  1047.     if (tty != -1)
  1048.       {
  1049.      
  1050. ***************
  1051. *** 318,324 ****
  1052. --- 339,352 ----
  1053.   /* Make the current tty use the state in shell_tty_info. */
  1054.   set_tty_state ()
  1055.   {
  1056. + /**
  1057. +  ** (sjk)++ Attach the terminal to CON: on the Atari ST
  1058. +  **/
  1059. + #if !defined(atarist)
  1060.     int tty = open ("/dev/tty", O_RDONLY);
  1061. + #else 
  1062. +   int tty = open("CON:", O_RDONLY);
  1063. + #endif 
  1064.     if (tty != -1)
  1065.       {
  1066.         if (!got_tty_state)
  1067. ***************
  1068. *** 326,336 ****
  1069.   #if defined (_POSIX_VERSION)
  1070.         tcsetattr (tty, TCSADRAIN, &shell_tty_info);
  1071.   #else
  1072. ! #  if defined (USG)
  1073. !       ioctl (tty, TCSETAW, &shell_tty_info);  /* Wait for output, no flush */
  1074. ! #  else
  1075.         ioctl (tty, TIOCSETN, &shell_tty_info);
  1076. ! #  endif
  1077.   #endif
  1078.         close (tty);
  1079.       }
  1080. --- 354,367 ----
  1081.   #if defined (_POSIX_VERSION)
  1082.         tcsetattr (tty, TCSADRAIN, &shell_tty_info);
  1083.   #else
  1084. ! /** 
  1085. !  ** (sjk)++ Set the terminal parameters ala USG if on an Atari ST
  1086. !  **/
  1087. ! #if defined (USG) || defined(atarist)
  1088.         ioctl (tty, TIOCSETN, &shell_tty_info);
  1089. ! #else
  1090. !       ioctl (tty, TCSETAW, &shell_tty_info);  /* Wait for output, no flush */
  1091. ! #endif
  1092.   #endif
  1093.         close (tty);
  1094.       }
  1095. diff -c ./parse.y /home/scott/work/bash-1.08/st-bash-src/parse.y
  1096. *** ./parse.y    Tue Aug 27 08:56:26 1991
  1097. --- /home/scott/work/bash-1.08/st-bash-src/parse.y    Wed Aug 21 02:36:44 1991
  1098. ***************
  1099. *** 671,676 ****
  1100. --- 671,680 ----
  1101.   /*                                    */
  1102.   /* **************************************************************** */
  1103.   
  1104. + #if defined(atarist)
  1105. + extern int console_read_byte();
  1106. + #endif
  1107.   int
  1108.   yy_stream_get ()
  1109.   {
  1110. ***************
  1111. *** 678,684 ****
  1112. --- 682,695 ----
  1113.   #if defined (USG)
  1114.       return (sysv_getc (yy_input_dev));
  1115.   #else
  1116. + /**
  1117. +  ** (sjk)++ Atari ST hack for input
  1118. +  **/
  1119. + #if !defined(atarist)
  1120.       return (getc (yy_input_dev));
  1121. + #else 
  1122. +     return(console_read_byte(fileno(yy_input_dev)));
  1123. + #endif 
  1124.   #endif    /* USG */
  1125.     else return (EOF);
  1126.   }
  1127. ***************
  1128. *** 1349,1354 ****
  1129. --- 1360,1370 ----
  1130.   {
  1131.     if (interactive && (!current_token || current_token == '\n'))
  1132.       {
  1133. + /**
  1134. +  ** (sjk)++
  1135. +  **/
  1136. + #if !defined(atarist)
  1137.         /* Before we print a prompt, we might have to check mailboxes.
  1138.        We do this only if it is time to do so. Notice that only here
  1139.        is the mail alarm reset; nothing takes place in check_mail ()
  1140. ***************
  1141. *** 1358,1363 ****
  1142. --- 1374,1380 ----
  1143.         check_mail ();
  1144.         reset_mail_timer ();
  1145.       }
  1146. + #endif
  1147.   
  1148.         /* Allow the execution of a random command just before the printing
  1149.        of each primary prompt.  If the shell variable PROMPT_COMMAND
  1150. ***************
  1151. *** 2183,2189 ****
  1152. --- 2200,2210 ----
  1153.      of MAXPATHLEN is a crock if you ask me.  Why can't we just have
  1154.      dynamically defined sizes?  (UCSB crashes every 20 minutes on me.) */
  1155.   #ifndef MAXPATHLEN
  1156. + #if !defined(atarist)
  1157.   #define MAXPATHLEN 1024
  1158. + #else 
  1159. + #define MAXPATHLEN 128
  1160. + #endif
  1161.   #endif    /* MAXPATHLEN */
  1162.   
  1163.   /* Return a string which will be printed as a prompt.  The string
  1164. diff -c ./shell.c /home/scott/work/bash-1.08/st-bash-src/shell.c
  1165. *** ./shell.c    Wed May 22 15:15:02 1991
  1166. --- /home/scott/work/bash-1.08/st-bash-src/shell.c    Wed Aug 21 00:26:26 1991
  1167. ***************
  1168. *** 38,43 ****
  1169. --- 38,44 ----
  1170.   #if !defined (sony)
  1171.   #include <fcntl.h>
  1172.   #endif /* sony */
  1173.   #include <sys/file.h>
  1174.   #include "posixstat.h"
  1175.   #include <pwd.h>
  1176. ***************
  1177. *** 132,139 ****
  1178. --- 133,148 ----
  1179.   
  1180.   /* The environment at the top-level REP loop.  We use this in the case of
  1181.      error return. */
  1182. + /**
  1183. +  ** (sjk)++ catch is defined in setjmp.h on the Atari ST
  1184. +  **/
  1185. + #if !defined(atarist)
  1186.   jmp_buf top_level, catch;
  1187. + #else 
  1188. + jmp_buf top_level;
  1189. + #endif
  1190.   
  1191.   /* Non-zero is the recursion depth for commands. */
  1192.   int indirection_level = 0;
  1193.   
  1194. ***************
  1195. *** 219,224 ****
  1196. --- 228,243 ----
  1197.            COMPAT_BSDTTY | COMPAT_EXEC | COMPAT_SYSCALLS);
  1198.   #endif /* AUX */
  1199.   
  1200. + /**
  1201. +  ** (sjk)++ Set the default unixmode as we cannot assume that the variable 
  1202. +  **         is set upon entering the shell.
  1203. +  **/
  1204. + #if defined(atarist)
  1205. +  if (!getenv("UNIXMODE")) _set_unixmode("/.,rCLAHdb");
  1206. +     else _set_unixmode(getenv("UNIXMODE"));
  1207. + #endif
  1208.     /* Wait forever if we are debugging a login shell. */
  1209.     while (debugging_login_shell);
  1210.   
  1211. ***************
  1212. *** 576,581 ****
  1213. --- 595,604 ----
  1214.     /* Do the things that should be done only for interactive shells. */
  1215.     if (interactive)
  1216.       {
  1217. + /**
  1218. +  ** (sjk)++ Remove all host/mail code on the Atari ST
  1219. +  **/
  1220. + #if !defined(atarist)
  1221.         /* Set up for checking for presence of mail. */
  1222.   #if defined (USG)
  1223.         /* Under System V, we can only tell if you have mail if the
  1224. ***************
  1225. *** 599,604 ****
  1226. --- 622,628 ----
  1227.       }
  1228.   
  1229.         reset_mail_timer ();
  1230. + #endif 
  1231.   
  1232.         change_flag_char ('i', FLAG_ON);
  1233.         
  1234. ***************
  1235. *** 898,904 ****
  1236.             {
  1237.           executing = 1;
  1238.           execute_command (current_command);
  1239. !           }
  1240.   
  1241.         exec_done:
  1242.           if (current_command)
  1243. --- 922,928 ----
  1244.             {
  1245.           executing = 1;
  1246.           execute_command (current_command);
  1247. !               }
  1248.   
  1249.         exec_done:
  1250.           if (current_command)
  1251. ***************
  1252. *** 988,994 ****
  1253.     /* Only do timeouts if interactive. */
  1254.     if (interactive)
  1255.       {
  1256. !       tmout_var = find_variable ("TMOUT");
  1257.   
  1258.         if (tmout_var && tmout_var->value)
  1259.       {
  1260. --- 1012,1022 ----
  1261.     /* Only do timeouts if interactive. */
  1262.     if (interactive)
  1263.       {
  1264. ! /**
  1265. !  ** (sjk)++ There is no nead to do an interative timeout on the Atari ST
  1266. !  **/
  1267. ! #if !defined(atarist)
  1268. !      tmout_var = find_variable ("TMOUT");
  1269.   
  1270.         if (tmout_var && tmout_var->value)
  1271.       {
  1272. ***************
  1273. *** 999,1004 ****
  1274. --- 1027,1033 ----
  1275.             alarm (tmout_len);
  1276.           }
  1277.       }
  1278. + #endif
  1279.       }
  1280.   
  1281.     QUIT;
  1282. ***************
  1283. *** 1005,1015 ****
  1284. --- 1034,1049 ----
  1285.   
  1286.     result = parse_command ();
  1287.   
  1288. + /**
  1289. +  ** (sjk)++ There is no need for an interactive timeout on the Atari ST
  1290. +  **/
  1291. + #if !defined(atarist)
  1292.     if (interactive && tmout_var && (tmout_len > 0))
  1293.       {
  1294.         alarm(0);
  1295.         signal (SIGALRM, old_alrm);
  1296.       }
  1297. + #endif
  1298.     return (result);
  1299.   }
  1300.   
  1301. ***************
  1302. *** 1321,1327 ****
  1303.   sigint_sighandler (sig)
  1304.        int sig;
  1305.   {
  1306. ! #if defined (USG) && !defined (_POSIX_VERSION)
  1307.     signal (sig, sigint_sighandler);
  1308.   #endif
  1309.   
  1310. --- 1355,1364 ----
  1311.   sigint_sighandler (sig)
  1312.        int sig;
  1313.   {
  1314. ! /**
  1315. !  **  (sjk)++ Offer up the signal ala USG on the Atari ST
  1316. !  **/
  1317. ! #if (defined (USG) && !defined(_POSIX_VERSION)) || defined(atarist)
  1318.     signal (sig, sigint_sighandler);
  1319.   #endif
  1320.   
  1321. diff -c ./shell.h /home/scott/work/bash-1.08/st-bash-src/shell.h
  1322. *** ./shell.h    Mon May 20 05:01:20 1991
  1323. --- /home/scott/work/bash-1.08/st-bash-src/shell.h    Wed Aug 14 15:01:15 1991
  1324. ***************
  1325. *** 20,26 ****
  1326. --- 20,33 ----
  1327.   /* A bunch of stuff for flow of control using setjmp () and longjmp (). */
  1328.   
  1329.   #include <setjmp.h>
  1330. + /**
  1331. +  ** (sjk)++ catch is defined in setjmp.h on the Atari ST
  1332. +  **/
  1333. + #if !defined(atarist)
  1334.   extern jmp_buf top_level, catch;
  1335. + #else
  1336. + extern jmp_buf top_level;
  1337. + #endif
  1338.   
  1339.   #define NOT_JUMPED 0        /* Not returning from a longjmp. */
  1340.   #define FORCE_EOF 1        /* We want to stop parsing. */
  1341. diff -c ./subst.c /home/scott/work/bash-1.08/st-bash-src/subst.c
  1342. *** ./subst.c    Tue Aug 27 08:56:27 1991
  1343. --- /home/scott/work/bash-1.08/st-bash-src/subst.c    Wed Aug 14 14:42:47 1991
  1344. ***************
  1345. *** 2254,2260 ****
  1346.            continue.  In the common case, at least when running shell
  1347.            scripts, this will degenerate to a bunch of calls to `index',
  1348.            and then what is basically the body of copy_word_list. */
  1349. !       if (index (tlist->word->word, '{') != NULL)
  1350.           {
  1351.             expansions = brace_expand (tlist->word->word);
  1352.   
  1353. --- 2254,2260 ----
  1354.            continue.  In the common case, at least when running shell
  1355.            scripts, this will degenerate to a bunch of calls to `index',
  1356.            and then what is basically the body of copy_word_list. */
  1357. !       if (index ((tlist->word->word), '{') != (int)NULL)
  1358.           {
  1359.             expansions = brace_expand (tlist->word->word);
  1360.   
  1361. ***************
  1362. *** 2451,2459 ****
  1363.   
  1364.   /* The functions that get called. */
  1365.   int
  1366. !   sv_path (), sv_mail (), sv_terminal (), sv_histsize (), sv_histfilesize (),
  1367.     sv_uids (), sv_ignoreeof (), sv_glob_dot_filenames (), sv_histchars (),
  1368. !   sv_nolinks (), sv_hostname_completion_file (), sv_history_control (),
  1369.     sv_noclobber (), sv_allow_null_glob_expansion (), sv_optind (), sv_opterr ();
  1370.   
  1371.   #if defined (JOB_CONTROL)
  1372. --- 2451,2473 ----
  1373.   
  1374.   /* The functions that get called. */
  1375.   int
  1376. !   sv_path (),
  1377. ! /**
  1378. !  ** (sjk)++ Remove all host/mail references on the Atari ST
  1379. !  **/
  1380. ! #if !defined(atarist)
  1381. !              sv_mail (),
  1382. ! #endif 
  1383. !   sv_terminal (), sv_histsize (), sv_histfilesize (),
  1384.     sv_uids (), sv_ignoreeof (), sv_glob_dot_filenames (), sv_histchars (),
  1385. !   sv_nolinks (), 
  1386. ! /**
  1387. !  ** (sjk)++ Remove all host/mail references on the Atari ST
  1388. !  **/
  1389. ! #if !defined(atarist)
  1390. !   sv_hostname_completion_file (), 
  1391. ! #endif 
  1392. !   sv_history_control (),
  1393.     sv_noclobber (), sv_allow_null_glob_expansion (), sv_optind (), sv_opterr ();
  1394.   
  1395.   #if defined (JOB_CONTROL)
  1396. ***************
  1397. *** 2465,2473 ****
  1398. --- 2479,2492 ----
  1399.     Function *function;
  1400.   } special_vars[] = {
  1401.     { "PATH", sv_path },
  1402. + /**
  1403. +  ** (sjk)++ Remove all host/mail references on the Atari ST
  1404. +  **/
  1405. + #if !defined(atarist)
  1406.     { "MAIL", sv_mail },
  1407.     { "MAILPATH", sv_mail },
  1408.     { "MAILCHECK", sv_mail },
  1409. + #endif
  1410.     { "TERMCAP", sv_terminal },
  1411.     { "TERM", sv_terminal },
  1412.     { "HISTSIZE", sv_histsize },
  1413. ***************
  1414. *** 2487,2493 ****
  1415. --- 2506,2517 ----
  1416.     { "allow_null_glob_expansion", sv_allow_null_glob_expansion },
  1417.     { "histchars", sv_histchars },
  1418.     { "nolinks", sv_nolinks },
  1419. + /**
  1420. +  ** (sjk)++ Remove all host/mail references on the Atari ST
  1421. +  **/
  1422. + #if !defined(atarist)
  1423.     { "hostname_completion_file", sv_hostname_completion_file },
  1424. + #endif
  1425.     { "history_control", sv_history_control },
  1426.     { "noclobber", sv_noclobber },
  1427.     { (char *)0x00, (Function *)0x00 }
  1428. ***************
  1429. *** 2537,2542 ****
  1430. --- 2561,2570 ----
  1431.   
  1432.   /* What to do just after one of the MAILxxxx variables has changed.  NAME
  1433.      is the name of the variable.  */
  1434. + /**
  1435. +  ** (sjk)++ Remove all host/mail references on the Atari ST
  1436. +  **/
  1437. + #if !defined(atarist)
  1438.   sv_mail (name)
  1439.        char *name;
  1440.   {
  1441. ***************
  1442. *** 2555,2560 ****
  1443. --- 2583,2589 ----
  1444.       }
  1445.       }
  1446.   }
  1447. + #endif 
  1448.   
  1449.   /* What to do just after one of the TERMxxx variables has changed.
  1450.      If we are an interactive shell, then try to reset the terminal
  1451. ***************
  1452. *** 2751,2756 ****
  1453. --- 2780,2789 ----
  1454.     v->attributes |= (att_readonly | att_integer);
  1455.   }
  1456.   
  1457. + /**
  1458. +  ** (sjk)++ Remove all host/mail references on the Atari ST
  1459. +  **/
  1460. + #if !defined(atarist)
  1461.   sv_hostname_completion_file (name)
  1462.        char *name;
  1463.   {
  1464. ***************
  1465. *** 2758,2763 ****
  1466. --- 2791,2797 ----
  1467.   
  1468.     hostname_list_initialized = 0;
  1469.   }
  1470. + #endif 
  1471.   
  1472.   sv_allow_null_glob_expansion (name)
  1473.        char *name;
  1474. diff -c ./trap.c /home/scott/work/bash-1.08/st-bash-src/trap.c
  1475. *** ./trap.c    Sun May 19 14:43:41 1991
  1476. --- /home/scott/work/bash-1.08/st-bash-src/trap.c    Wed Aug 14 14:51:00 1991
  1477. ***************
  1478. *** 285,293 ****
  1479. --- 285,298 ----
  1480.   /* Non-zero when we catch a trapped signal. */
  1481.   static int catch_flag = 0;
  1482.   
  1483. + /**
  1484. +  ** (sjk)++ NO BSD type signals on the Atari ST1
  1485. +  **/
  1486. + #if !defined(atarist)
  1487.   #if !defined (USG) && !defined (USGr4)
  1488.   #define HAVE_BSD_SIGNALS
  1489.   #endif
  1490. + #endif
  1491.   
  1492.   run_pending_traps ()
  1493.   {
  1494. ***************
  1495. *** 362,368 ****
  1496.     if (original_signals[sig] == SIG_IGN)
  1497.       return;
  1498.   
  1499. ! #ifdef SIGCHLD
  1500.     /* Don't change the function that catches SIGCHLD, but store the command
  1501.        to be executed.  It will be run from jobs.c: flush_child(). */
  1502.     if (sig && (sig != SIGCHLD))
  1503. --- 367,373 ----
  1504.     if (original_signals[sig] == SIG_IGN)
  1505.       return;
  1506.   
  1507. ! #if  defined(SIGCHLD)
  1508.     /* Don't change the function that catches SIGCHLD, but store the command
  1509.        to be executed.  It will be run from jobs.c: flush_child(). */
  1510.     if (sig && (sig != SIGCHLD))
  1511. ***************
  1512. *** 373,379 ****
  1513.   
  1514.     change_signal (sig, savestring (string));
  1515.   
  1516. ! #ifdef SIGCHLD
  1517.     /* Don't change the function that catches SIGCHLD, but store the command
  1518.        to be executed.  It will be run from jobs.c: flush_child(). */
  1519.     if (sig && (sig != SIGCHLD))
  1520. --- 378,384 ----
  1521.   
  1522.     change_signal (sig, savestring (string));
  1523.   
  1524. ! #if defined(SIGCHLD)
  1525.     /* Don't change the function that catches SIGCHLD, but store the command
  1526.        to be executed.  It will be run from jobs.c: flush_child(). */
  1527.     if (sig && (sig != SIGCHLD))
  1528. ***************
  1529. *** 401,410 ****
  1530.   restore_default_signal (sig)
  1531.        int sig;
  1532.   {
  1533. - #ifdef SIGCHLD
  1534.     /* Don't allow the SIGCHLD signal catcher to be overridden. */
  1535.     if (sig != SIGCHLD)
  1536. - #endif
  1537.       signal (sig, original_signals[sig]);
  1538.     change_signal (sig, (char *)DEFAULT_SIG);
  1539.   }
  1540. --- 406,413 ----
  1541. ***************
  1542. *** 414,423 ****
  1543.   ignore_signal (sig)
  1544.        int sig;
  1545.   {
  1546. - #ifdef SIGCHLD
  1547.     /* Don't allow the SIGCHLD signal catcher to be overridden. */
  1548.     if (sig != SIGCHLD)
  1549. - #endif
  1550.       signal (sig, SIG_IGN);
  1551.     change_signal (sig, (char *)IGNORE_SIG);
  1552.   }
  1553. --- 417,424 ----
  1554. diff -c ./ulimit.c /home/scott/work/bash-1.08/st-bash-src/ulimit.c
  1555. *** ./ulimit.c    Fri May 17 20:17:03 1991
  1556. --- /home/scott/work/bash-1.08/st-bash-src/ulimit.c    Mon Aug 19 15:01:54 1991
  1557. ***************
  1558. *** 29,34 ****
  1559. --- 29,40 ----
  1560.   #if defined (HAVE_RESOURCE)
  1561.   #include <sys/time.h>
  1562.   #include <sys/resource.h>
  1563. + /**
  1564. +  ** We require some library support on the Atari ST
  1565. +  **/
  1566. + #if defined(atarist)
  1567. + #include "../lib+/r-res.h"
  1568. + #endif
  1569.   #else
  1570.   #include <sys/times.h>
  1571.   #endif
  1572. diff -c ./variables.c /home/scott/work/bash-1.08/st-bash-src/variables.c
  1573. *** ./variables.c    Fri May 17 20:33:53 1991
  1574. --- /home/scott/work/bash-1.08/st-bash-src/variables.c    Mon Aug 26 10:27:45 1991
  1575. ***************
  1576. *** 66,76 ****
  1577. --- 66,81 ----
  1578.   /* The list of variables that may not be unset in this shell. */
  1579.   char **non_unsettable_vars = (char **)NULL;
  1580.   
  1581. + /**
  1582. +  **  (sjk)++ Remove all mail references on the Atari ST 
  1583. +  **/
  1584. + #if !defined(atarist)   
  1585.   #if defined (USG)
  1586.   #define DEFAULT_MAIL_PATH "/usr/mail/"
  1587.   #else
  1588.   #define DEFAULT_MAIL_PATH "/usr/spool/mail/"
  1589.   #endif
  1590. + #endif 
  1591.   
  1592.   /* Some forward declarations. */
  1593.   SHELL_VAR *set_if_not ();    /* returns new or existing entry */
  1594. ***************
  1595. *** 136,141 ****
  1596. --- 141,157 ----
  1597.   
  1598.     /* Now make our own defaults in case the vars that we think are
  1599.        important are missing. */
  1600. + /**
  1601. +  ** (sjk)++ We set some default environment variables, provided 
  1602. +  **         that they are not defined.
  1603. +  **/
  1604. + #if defined(atarist)
  1605. +   set_if_not("UNIXMODE","/.,rCLAHdb");   /* Set a default Unixmode */ 
  1606. +   set_if_not("HOME","/dev/A");
  1607. +   set_if_not("TERM","vt52");
  1608. + #endif 
  1609.     temp_var = set_if_not ("PATH", DEFAULT_PATH_VALUE);
  1610.     set_auto_export (temp_var);
  1611.   
  1612. ***************
  1613. *** 150,155 ****
  1614. --- 166,175 ----
  1615.     temp_var = set_if_not ("HOSTTYPE", HOSTTYPE);
  1616.     set_auto_export (temp_var);
  1617.   
  1618. + /**
  1619. +  **  (sjk)++ Remove all mail references on the Atari ST 
  1620. +  **/
  1621. + #if !defined(atarist)   
  1622.     /* Default MAILPATH, and MAILCHECK. */
  1623.     set_if_not ("MAILCHECK", "60");
  1624.     if ((get_string_value ("MAIL") == (char *)NULL) &&
  1625. ***************
  1626. *** 166,171 ****
  1627. --- 186,192 ----
  1628.         bind_variable ("MAILPATH", tem);
  1629.         free (tem);
  1630.       }
  1631. + #endif
  1632.   
  1633.     /* Set up $PWD. */
  1634.     {
  1635. ***************
  1636. *** 280,286 ****
  1637.       set_if_not ("HISTFILE", tem);
  1638.       free (tem);
  1639.   
  1640. !     set_if_not ("HISTSIZE", "500");
  1641.       sv_histsize ("HISTSIZE");
  1642.     }
  1643.   
  1644. --- 301,307 ----
  1645.       set_if_not ("HISTFILE", tem);
  1646.       free (tem);
  1647.   
  1648. !     set_if_not ("HISTSIZE", "50");
  1649.       sv_histsize ("HISTSIZE");
  1650.     }
  1651.   
  1652. ***************
  1653. *** 350,356 ****
  1654.         return;
  1655.   
  1656.     non_unsettable_vars = (char **)
  1657. !     xrealloc (non_unsettable_vars, (2 + i) * sizeof (char *));
  1658.     non_unsettable_vars[i] = savestring (name);
  1659.     non_unsettable_vars[i + 1] = (char *)NULL;
  1660.   }
  1661. --- 371,377 ----
  1662.         return;
  1663.   
  1664.     non_unsettable_vars = (char **)
  1665. !     xrealloc ((char *)non_unsettable_vars, (2 + i) * sizeof (char *));
  1666.     non_unsettable_vars[i] = savestring (name);
  1667.     non_unsettable_vars[i + 1] = (char *)NULL;
  1668.   }
  1669. ***************
  1670. *** 393,399 ****
  1671.           {
  1672.             if (list_index + 1 >= list_size)
  1673.           list = (SHELL_VAR **)
  1674. !           xrealloc (list, (list_size += 20) * sizeof (SHELL_VAR *));
  1675.   
  1676.             list[list_index++] = var;
  1677.             list[list_index] = (SHELL_VAR *)NULL;
  1678. --- 414,420 ----
  1679.           {
  1680.             if (list_index + 1 >= list_size)
  1681.           list = (SHELL_VAR **)
  1682. !           xrealloc ((char *)list, (list_size += 20) * sizeof (SHELL_VAR *));
  1683.   
  1684.             list[list_index++] = var;
  1685.             list[list_index] = (SHELL_VAR *)NULL;
  1686. ***************
  1687. *** 1353,1359 ****
  1688.   
  1689.     size = array_len (temporary_env);
  1690.     temporary_env = (char **)
  1691. !     xrealloc (temporary_env, (size + 2) * (sizeof (char *)));
  1692.   
  1693.     temporary_env[size] = (temp);
  1694.     temporary_env[size + 1] = (char *)NULL;
  1695. --- 1374,1380 ----
  1696.   
  1697.     size = array_len (temporary_env);
  1698.     temporary_env = (char **)
  1699. !     xrealloc ((char *)temporary_env, (size + 2) * (sizeof (char *)));
  1700.   
  1701.     temporary_env[size] = (temp);
  1702.     temporary_env[size + 1] = (char *)NULL;
  1703. ***************
  1704. *** 1454,1460 ****
  1705.         return (array);
  1706.       }
  1707.       }
  1708. !   array = (char **)xrealloc (array, (2 + array_len (array)) * sizeof (char *));
  1709.     array[i++] = savestring (assign);
  1710.     array[i] = (char *)NULL;
  1711.     return (array);
  1712. --- 1475,1481 ----
  1713.         return (array);
  1714.       }
  1715.       }
  1716. !   array = (char **)xrealloc ((char *)array, (2 + array_len (array)) * sizeof (char *));
  1717.     array[i++] = savestring (assign);
  1718.     array[i] = (char *)NULL;
  1719.     return (array);
  1720. ***************
  1721. *** 1539,1545 ****
  1722.   #if !defined (NeXT)
  1723.   char *
  1724.   getenv (name)
  1725. !      char *name;
  1726.   {
  1727.     SHELL_VAR *var = find_tempenv_variable (name);
  1728.   
  1729. --- 1560,1566 ----
  1730.   #if !defined (NeXT)
  1731.   char *
  1732.   getenv (name)
  1733. !      const char *name;
  1734.   {
  1735.     SHELL_VAR *var = find_tempenv_variable (name);
  1736.   
  1737.